package com.changgou.pay.feign;

import com.changgou.entity.Result;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestParam;

@FeignClient(name = "pay")
public interface WxPayFeign {

    /**
     * @param orderId
     * @param money
     * @return com.changgou.entity.Result
     * @description: 生成微信支付二维码
     * @author 大佬味的小男孩
     * @date 2020/08/04 20:59
     */
    @GetMapping("/wxpay/nativePay")
    public Result nativePay(@RequestParam("orderId") String orderId, @RequestParam("money") Integer money);


    /**
     * @param orderId
     * @return com.changgou.entity.Result
     * @description: 基于微信查询订单
     * @author 大佬味的小男孩
     * @date 2020/08/05 20:38
     */
    @GetMapping("/wxpay/query/{orderId}")
    public Result queryOrder(@PathVariable("orderId") String orderId);


    /**
     * @param orderId
     * @return com.changgou.entity.Result
     * @description: 基于微信关闭订单
     * @author 大佬味的小男孩
     * @date 2020/08/05 20:55
     */
    @PutMapping("/wxpay/close/{orderId}")
    public Result close(@PathVariable("orderId") String orderId);
}
